import _Button from './Button.vue'
import type {App, Plugin} from 'vue'

type SFCWithInstall<T> = T & Plugin
const withInstall = <T extends { name: string }>(sfc: T) => {
    (sfc as SFCWithInstall<T>).install = (app: App) => {
        app.component(sfc.name, sfc)
    }
    return sfc as SFCWithInstall<T>
}

const Button = withInstall(_Button)
export default Button